package com.up.upzl.biz.domain;

import java.math.BigDecimal;

import javax.persistence.Entity;
import javax.persistence.JoinColumn;
import javax.persistence.OneToOne;
import javax.persistence.Transient;

import com.up.upzl.base.domain.BaseDomain;

import lombok.Getter;
import lombok.Setter;

/**
 * 拍店
 * 
 * @author geeks
 *
 */
@Getter
@Setter
@Entity
public class PaiDianRecord extends BaseDomain {

	private static final long serialVersionUID = 6011482191823079346L;

	/**
	 * 微信ID
	 */
	private String wechatId;

	private String huanxian1;

	/**
	 * 拍店人
	 */
	private String phone;

	/**
	 * 店主
	 */
	private String ipone;

	/**
	 * 区域
	 */
	@OneToOne
	@JoinColumn(name = "area_id")
	private Area area;

	/**
	 * 商圈
	 */
	@OneToOne
	@JoinColumn(name = "business_area_id")
	private BusinessArea businessArea;

	/**
	 * 横坐标
	 */
	private String locationX;

	/**
	 * 纵坐标
	 */
	private String locationY;

	/**
	 * 商铺正面照
	 */
	private String img0;

	/**
	 * 商铺左侧照
	 */
	private String img1;

	/**
	 * 商铺右侧照
	 */
	private String img2;

	/**
	 * 电话张贴照
	 */
	private String img3;

	/**
	 * 附加照片1
	 */
	private String img4;

	/**
	 * 附加照片2
	 */
	private String img5;

	/**
	 * 附加照片3
	 */
	private String img6;

	/**
	 * 附加照片4
	 */
	private String img7;

	/**
	 * 环线
	 */
	private HuanXian huanXian;

	private String diqu;

	/**
	 * 拍店时间
	 * 
	 * @author geeks
	 */

	public enum HuanXian {
		NONE("不限"), TWO("2环内"), THREE("2-3环"), FOUR("3-4环"), FIVE("4-5环"), SIX("五环外");

		private String text;

		private HuanXian(String text) {
			this.text = text;
		}

		public String getText() {
			return text;
		}

		@Override
		public String toString() {
			return text;
		}
	}

	/**
	 * 状态
	 */
	private Status status;

	public enum Status {
		待审核, 已通过, 未通过, 待认领, 已认领
	}

	/**
	 * 拒绝理由
	 */
	private String reason;

	/**
	 * 奖金发放状态
	 */
	private JiangjinStatus jiangjinStatus;

	public enum JiangjinStatus {
		待发放, 已发放
	}

	/**
	 * 基础奖励
	 */
	@Transient
	private BigDecimal basicJJ;

	/**
	 * 额外奖励
	 */
	public BigDecimal getExtJJ() {
		BigDecimal extJJ = null;
		switch (this.huanXian) {
		case NONE:
			extJJ = new BigDecimal(0);
			break;
		case TWO:
			extJJ = new BigDecimal(2);
			break;
		case THREE:
			extJJ = new BigDecimal(1.5);
			break;
		case FOUR:
			extJJ = new BigDecimal(1);
			break;
		case FIVE:
			extJJ = new BigDecimal(0.5);
			break;
		default:
			extJJ = new BigDecimal(0);
			break;
		}
		return extJJ;
	}

	/**
	 * 基础奖励
	 */
	private BigDecimal basicJiang;

	/**
	 * 额外奖励
	 */
	private BigDecimal extJiang;

}
